<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>我的订单</title>
    <%@ include file="/pages/common/head.jsp" %>
    <style type="text/css">
        h1 {
            text-align: center;
            margin-top: 200px;
        }
    </style>
</head>
<body>

<div id="header">
    <img class="logo_img" alt="" src="static/img/logo.gif">
    <span class="wel_word">我的订单</span>
    <%@ include file="/pages/common/login_success_menu.jsp" %>
</div>

<div id="main">
<c:if test="${empty requestScope.orders}">
    <h1>没有对应的订单，<a href="/book/index.jsp">赶紧去买吧</a></h1>
</c:if>
    <c:if test="${ ! empty requestScope.orders}">
        <table>
            <tr>
                <td>单号</td>
                <td>日期</td>
                <td>金额</td>
                <td>状态</td>
                <td>详情</td>
            </tr>
            <c:forEach items="${requestScope.orders}" var="item">
                <tr>
                    <td>${item.orderId}</td>
                    <td>${item.createTime}</td>
                    <td>${item.price}</td>
                    <td>
                        <c:choose>
                            <c:when test="${item.status==0}">
                                未发货
                            </c:when>
                            <c:when test="${item.status==1}">
                                <a href="orderServlet?action=receiverOrder&orderId=${item.orderId}">确认收货</a>
                            </c:when>
                            <c:otherwise>
                                交易完成
                            </c:otherwise>
                        </c:choose>
                    </td>
                    <td><a href="orderServlet?action=showOdersDetail&orderId=${item.orderId}">查看详情</a></td>
                </tr>
            </c:forEach>
        </table>
    </c:if>



</div>

<%@ include file="/pages/common/footer.jsp" %>
</body>
</html>